<template>
	<view class="content">
		<view class="itemG" v-for="(item,index) in goodsList" :key="index">
			<view class="itemTitle">{{item.title}}</view>
			<view class="itemS">
				<view class="item"  v-for="(sonItem,sonIndex) in item.Arr" :key='sonIndex' :class="sonIndex == item.choice?'itemActive':''" @click="btnChioceClick(index,sonIndex)">
					{{sonItem.key}}
					<image v-if="sonIndex == item.choice" src="../../static/chioceSan.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="btnGroup">
			<view class="btn" @click="btnReloadClick">{{msgDict.reset}}</view>
			<view class="btn showBtn" @click="btnSumitClick">{{msgDict.submit}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msgDict:{},
				goodsList:[{title:'全部分类',choice:-1,Arr:[{key:'1CY成衣'},{key:'1CY成'},{key:'1CY成'},{key:'1CY成'},{key:'1CY成'},{key:'1C1Y成衣'}]},{title:'全部类',choice:-1,Arr:[{key:'1CY成衣'},{key:'1CY成'},{key:'1C1Y成衣'}]},{title:'全分类',choice:-1,Arr:[{key:'1CY成衣'},{key:'1CY成'},{key:'1C1Y成衣'}]}]
			}
		},
		onLoad() {
			this.msgDict = getApp().globalData.$t('ApplyProductType');
		},
		methods: {
			btnChioceClick(index,sonIndex){
				this.goodsList[index].choice = sonIndex
			},
			btnReloadClick(){
				this.goodsList = this.goodsList.map(v=>{
					v.choice = -1
					return v
				})
			},
			btnSumitClick(){
				
			}
		}
	}
</script>

<style lang="less">
.content{
	padding-left: 20rpx;
}
.itemG{
	padding-top: 30rpx;
	.itemTitle{
		font-weight: 500;
		color: #333333;
		font-size: 28rpx;
	}
	.itemS{
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		.item{
			width: 160rpx;
			height: 68rpx;
			line-height: 68rpx;
			text-align: center;
			border: 1rpx solid #DEDEDE;
			margin-top: 30rpx;
			color: #333;
			font-weight: 400;
			font-size: 24rpx;
			margin-right: 18rpx;
			position: relative;
			
			
			image{
				position: absolute;
				right: 0;
				bottom: 0;
				width: 38rpx;
				height: 38rpx;
			}
		}
		.itemActive{
			border: 1rpx solid #0005C9;
			color: #0005C9;
		}
		
	}
}

.btnGroup{
   position: fixed;
   bottom: 0;
   left: 0;
   width: 690rpx;
   height: 100rpx;
   border-top: 1rpx solid rgba(0,0,0,0.1);
   display: flex;
   // align-items: center;
   padding: 15rpx 30rpx 0;
   justify-content: space-between;
   padding-bottom: 10upx;
   padding-bottom: calc(10rpx + constant(safe-area-inset-bottom));  
   padding-bottom: calc(10rpx + env(safe-area-inset-bottom));
   .btn{
	   
	   border: 1px solid #DEDEDE;
	   color: #333;
	   background-color: #fff;
	   height: 70rpx;
	   width: 330rpx;
	   line-height: 70rpx;
	   border-radius: 2rpx;
	   font-size: 28rpx;
	   text-align: center; 
   }
   .showBtn{
	   color: #fff;
	   background: linear-gradient(135deg, #2D63F9 0%, #6421D3 100%);
   }
}
</style>
